package com.fy.route.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class GatewayConfig {
    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder routeLocatorBuilder) {
        // 1 、简单路由
        return routeLocatorBuilder.routes()
                .route(r -> r.path("/route")
                        .uri("http://localhost:8090")
                        .id("path_route"))
                .build();
    }
}
